<%--
  Created by IntelliJ IDEA.
  User: wh110
  Date: 2021/11/19
  Time: 16:44
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
    <style>
        tr td{
            text-align: center;
        }
    </style>
</head>
<body>
<jsp:include page="top.jsp"></jsp:include>
<center>
    <form action="search">
        姓名<input type="text" name="name" size="8">
        性别<select name="sex">
            <option selected>请选择性别</option>
            <option value="0">男</option>
            <option value="1">女</option>
        </select>
        <input type="submit" value="查询">
    </form>
</center>
    <a href="addStu.jsp" style="margin:100px 700px">添加学生</a>
    <table border="1px" cellspacing="0px" align="center" width="60%" height="500px">
        <caption>学生信息展示</caption>
        <tr>
            <th>学号</th>
            <th>姓名</th>
            <th>密码</th>
            <th>性别</th>
            <th>手机</th>
            <th>生日</th>
            <th>头像</th>
            <th>操作</th>
        </tr>
        <c:forEach var="s" items="${list}">
                <tr>
                   <td>${s.id}</td>
                   <td>${s.name}</td>
                   <td>${s.pwd}</td>
                   <td>
                    <c:if test="${s.sex==0}">
                        男
                    </c:if>
                    <c:if test="${s.sex==1}">
                        女
                    </c:if>
                   </td>
                   <td>${s.tel}</td>
                   <td>${s.bir}</td>
                   <td>
                        <img src="/pic/${s.spic}" height="80px"/>
                   </td>
                   <td><a href="delStuById?id=${s.id}">删除</a>
                        <a href="updateUser1?id=${s.id}">修改</a>
                   </td>
                </tr>
        </c:forEach>
    </table>
<center>
    <a href="page?index=0">首页</a>
    <a href="page?index=${index-5}">上一页</a>
    <a href="page?index=0">1</a>
    <a href="page?index=5">2</a>
    <a href="page?index=10">3</a>
    <a href="page?index=${index+5}">下一页</a>
</center>
</body>
</html>
